define(function(require, exports){
	var pubjs	= require('pubjs');
	var Aptitude = require('admin/aptitude/action/edit').main;

	var PopwinForm = Aptitude.extend({
		init: function(config, parent){
			config = pubjs.conf(config, {

			});

			this.Super('init', arguments);
		},

		afterSave: function(err, data){
			if (err){
				pubjs.alert(err.message);
				return false;
			}
			pubjs.alert(LANG('保存成功'));

			this.reset();
			this.fire('saveSuccess');
		},
		// 取消-返回
		cancel: function(){
			//切去客户列表页面
			this.fire('cancel');
		}
	});

	exports.popForm = PopwinForm;

});